<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"
    import="java.util.*"
    import="java.sql.*"
    import="henu.bean.*"
    import="henu.others.*"
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>在线考试系统</title>
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/jquery-2.1.4.js"></script>
<script src="../js/bootstrap.min.js"></script>
<style>
body{background-image: url(../picture/bg3.jpg);
	background-size: cover;
}
</style>
</head>
<body>		
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="teacherHome.jsp">在线考试系统</a>
    </div>
     <div>
						<ul class="nav navbar-nav">
							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown">试题管理<strong class="caret"></strong></a>
								<ul class="dropdown-menu">
									<li><a href="addQuestion.jsp">添加试题</a></li>
									<li><a
										href="../ManagementQuestion?method=findchoiceQuestion">选择题维护</a>
									</li>
									<li><a
										href="../ManagementQuestion?method=findmultichoiceQuestion">多选题维护</a>
									</li>
									<li><a
										href="../ManagementQuestion?method=findjudgeQuestion">判断题维护</a>
									</li>
								</ul></li>
							<li class="dropdown"><a href="#" class="dropdown-toggle"
											data-toggle="dropdown">发布试卷<strong class="caret"></strong></a>
										<ul class="dropdown-menu">
											<li><a href="makePaper.jsp">随机组卷</a>
											</li>
											<li><a href="makePaperV3.jsp">手动组卷</a>
											</li>
										</ul>
									</li>
							<li><a href="../ReleaseHistory?method=findpaperHistory">历史发布</a>
							</li>
							<li><a href="../Statistics?method=findStatistics">统计情况</a></li>
							<li class="active"><a href="../ManagementMessage?method=findAcceptMessage">学生留言</a></li>
						</ul>
					</div>
    				<ul class="nav navbar-nav navbar-right">
						<li class="dropdown"><a href="#" class="dropdown-toggle"
							data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span>我的<strong
								class="caret"></strong></a>
							<ul class="dropdown-menu">
								<li><a href="../PersonalInfo?method=findTeacherInfo">个人信息</a>
								</li>
								<li><a href="updateTPW.jsp">修改密码</a></li>
								<li><a href="../LoginServlet?usertype=logout">注销</a></li>
							</ul></li>
					</ul>
</div>
</nav>

<div  class="jumbotron">
<%
List<Message> record = (List<Message>)session.getAttribute("messageList");
%>
<%if (record == null || record.size() == 0) {
		out.println("<center><strong>还没有留言信息~</strong></center>");						
		}
	else {%>
	<table id="table" class="table table-hover table-bordered">
    <thead> 
    <tr>
     <th>学生</th>
     <th>留言内容</th>
     <th>回复</th>
     <th>操作</th>
    </tr>
    </thead>
    <tbody>
		<% for (Message r : record) {	
	%>
    <tr class="warning">
     <td><%=r.getSname() %></td>
     <td><%=r.getContent() %></td>
     <td><%=r.getReply() %></td>       
     <td>
     	<a href="#" data-toggle="modal" data-target="#myModal" onclick="values(<%=r.getMid()%>)">回复</a>
     </td>
    </tr>
   <!--orderList/-->
   <%
		}}
   %>
   </tbody>
</table>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">留言回复</h4>
            </div>
            <form method="post" action="../ManagementMessage?method=replyMessage">
            <div class="modal-body">
            	<input type="hidden" name="mid" id="mid" /> 
            	<textarea class="form-control" name="reply"
									placeholder="请输入留言内容"></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">回复</button>
            </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
	</div>
</div>

<script type="text/javascript">
function values(mid) {  
   
    document.getElementById("mid").value = mid;
}  
</script>

</body>
</html>